# 用户模块的蓝图，包括用户模块的所有资源
from flask import Blueprint
from flask_restful import Api
from shopping.resources.user.user_resource import Shopping_user, Send_SMS, AuthorRlationCode, RegiseterResource, Login
from comment.utils.ouput import output_json

user_bp = Blueprint('users', __name__, url_prefix='/user')

# 创建一个api
user_api = Api(user_bp)
# 自定义输出的格式为json，替代装饰器的写法
user_api.representation('application/json')(output_json)
# 验证日志
user_api.add_resource(Shopping_user, '/hello', endpoint='user')
# 验证短信发送
user_api.add_resource(Send_SMS, '/sms')
# 验证手机验证码
user_api.add_resource(AuthorRlationCode, '/code_parse')
# 注册功能
user_api.add_resource(RegiseterResource, '/register')
# 登录
user_api.add_resource(Login, '/login')
